package ar.com.tallerdos.smartdinner.business;

import java.util.List;

import ar.com.tallerdos.smartdinner.dao.GuarnicionDao;
import ar.com.tallerdos.smartdinner.model.Agregado;

public class AgregadoBusiness {
    private static GuarnicionDao dao;
    
    public static Agregado findById(Integer id) {
	return getDao().findById(id);
    }
    
    public static List<Agregado> findAll() {
	return getDao().findAll();
    }
    
    public static void create(Agregado entity) {
	getDao().create(entity);
    }
    
    public static Boolean delete(Agregado entity) {
	return delete(entity.getId());
    }
    
    public static Boolean delete(Integer id) {
	return getDao().delete(id);
    }
    
    public static Boolean update(Agregado entity) {
	return getDao().update(entity);
    }
    
    public static Boolean createOrUpdate(Agregado entity) {
	return getDao().createOrUpdate(entity);
    }

    public static GuarnicionDao getDao() {
	if (dao == null) {
	    dao = new GuarnicionDao();
	}
        return dao;
    }

    public static void setDao(GuarnicionDao dao) {
	AgregadoBusiness.dao = dao;
    }
}
